import 'package:library_base/entities/bluetooth_device_entity.dart';
import 'package:library_base/entities/device_entity.dart';
import 'package:library_base/entities/generated/json/base/json_convert_content.dart';

DeviceEntity $DeviceEntityFromJson(Map<String, dynamic> json) {
  final DeviceEntity shipperEntity = DeviceEntity();

  final BluetoothDeviceEntity? device = BluetoothDeviceEntity.fromJson(json['device']);
  if (device != null) {
    shipperEntity.device = device;
  }

  final int? rssi = jsonConvert.convert<int>(json['rssi']);
  if (rssi != null) {
    shipperEntity.rssi = rssi;
  }

  // final List<int> scanRecord = jsonConvert.convertList<int>(json['scanRecord']);
  // shipperEntity.scanRecord = scanRecord;

  return shipperEntity;
}

Map<String, dynamic> $DeviceEntityToJson(DeviceEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['device'] = entity.device;
  data['rssi'] = entity.rssi;
  // data['scanRecord'] = entity.scanRecord;
  return data;
}
